#include"../include/head.h"
/* Usage:  */



int main(int argc, char *argv[]){                                  
    //任务队列
    task_queue_t short_task_queue; // 处理 cd/ls 等短命令
    task_queue_t long_task_queue;
    shareRes_t shareRes;
    task_queue_init(&long_task_queue);
    task_queue_init(&short_task_queue);
        // 初始化mysql锁
    pthread_mutex_t mysql_mutex = PTHREAD_MUTEX_INITIALIZER;
    //创建工人
    shareResInit(&shareRes, 2, 1);
    make_long_work(&shareRes, 2);
    make_short_work(&shareRes, 1);
    int sockfd = initTcp("192.168.218.128", "12345");
    int epfd = epoll_create(1);
    epollAdd(epfd, sockfd, 0);


    //lianjie mysql
    pthread_mutex_lock(&mysql_mutex);
    MYSQL *mysql = mysql_init(NULL);
    MYSQL *connect_ret = mysql_real_connect(mysql, "localhost", "root", "031178514530", "user_base", 0, NULL, 0);
    if(connect_ret == NULL)
    {
        fprintf(stderr, "%s:%s\n", "mysql connect", mysql_error(connect_ret));
        exit(-1);
    }
    pthread_mutex_unlock(&mysql_mutex);



















    return 0;

}

